
//节流
type throttle = any
export const throttle:throttle = function(fn:any,wait:any){
    let timer:any = null;
    return function(){
        let context = {};
        let args = arguments;
        if(!timer){
            timer = setTimeout(function(){
                fn.apply(context,args);
                timer = null;
            },wait)
        }
    }
}